package com.study.jvm;

/**
 * @author geticsen
 */
public class MemoryDetection {
    /**
     *
     * @param args
     * @throws InterruptedException
     *
     * jps
     * jmap -heap pid
     * jconsole
     * jvisualvm
     */
    public static void main(String[] args) throws InterruptedException {
        System.out.println("start");
        Thread.sleep(20000);
        byte arr[] = new byte[1024 * 1024 * 10]; //10MB
        System.out.println("init");
        Thread.sleep(20000);
        arr = null;
        System.gc();
        System.out.println("end");
        Thread.sleep(10000000000L);
    }
}
